package tool.zyk.controller;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tool.zyk.bo.AppointmentBO;
import tool.zyk.service.AppointmentService;

import javax.annotation.Resource;

/**
 * @author feite.zyk
 * @time 2024/2/2 15:41
 * @description
 */
@RestController
@RequestMapping("appointment")
public class AppointController implements ApplicationContextAware {
    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Resource
    private AppointmentService appointmentService;

    @GetMapping("obtainAppointmentInfo/{id}")
    public AppointmentBO obtainAppointmentInfo(@PathVariable Long id) {
        return appointmentService.getAppointmentInfo(id);
    }
}
